<template>
  <a-card :bordered="false">
    <div class="table-page-search-wrapper">
      <div class="table-operator" style="border-top: 5px">
        <a-button type="primary" @click="handleAdd">新增</a-button>
      </div>
      <a-table
        ref="table"
        rowKey="id"
        size="middle"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        @change="handleTableChange">
        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record)">
            <a-icon type="edit"/>
            编辑
          </a>
          <a-divider type="vertical"/>
          <a-divider type="vertical"/>
          <a-popconfirm title="确定删除吗?" @confirm="() =>handleDelete(record.id)">
            <a>删除</a>
          </a-popconfirm>
        </span>
      </a-table>
    </div>
    <bladeUmbrellaLocation-Modal ref='modalForm' @ok="modalFormOk"></bladeUmbrellaLocation-Modal>
  </a-card>
</template>

<script>
import { listBladeUmbrellaLocation, delBladeUmbrellaLocation } from "@/api/umbrella/BladeUmbrellaLocation";
import bladeUmbrellaLocationModal from '../modules/bladeUmbrellaLocationModal'
import { UmbrellaListMixin } from '@/mixins/UmbrellaListMixin'
import { filterObj } from '@/utils/util';
export default {
  name: "bladeUmbrellaLocation",
  components: {bladeUmbrellaLocationModal},
  mixins:[UmbrellaListMixin],
  data() {
    return {
      // 查询条件
      queryParam: {},
      // 表头
      columns: [
        {
          title: '编号',
          align: "center",
          dataIndex: 'id',
        },
        {
          title: '地点名称',
          align: "center",
          dataIndex: 'locationName',
        },
        {
          title: '经度',
          align: "center",
          dataIndex: 'longitude',
        },
        {
          title: '纬度',
          align: "center",
          dataIndex: 'latitude',
        },
        {
          title: '营业时间',
          align: "center",
          dataIndex: 'openingTours',
        },
        {
          title: '操作',
          dataIndex: 'action',
          align: "center",
          scopedSlots: {customRender: 'action'},
        }
      ],
      url: {
        list: "/api/gateway/jic-backend-activity/BladeUmbrellaLocation/list",
        delete: "/api/gateway/jic-backend-activity/BladeUmbrellaLocation/remove",
      },
      // 查询参数
      queryParam:{
        current: 1,
        size: 10,
      },
      // 数据 -- 表格
      dataSource:[],
      // loading 是否显示  请求表格列表之前 设置为true   请求结束设置为false
      loading:false,

    };
  },
  created() {
    // this.getList();
  },
  methods: {
    getQueryParams() {
      var param = Object.assign({}, this.queryParam);
      param.current = this.ipagination.current;
      param.pageSize = this.ipagination.pageSize;
      return filterObj(param);
    },
    // 重置搜索框的内容
    searchReset() {
      var that = this;
      that.loadData(this.ipagination.current);
    },

  }
};
</script>
